import { defineStore } from "pinia";
import { ref } from "vue";

//用户信息仓库
const useUserStore = defineStore("user",()=>{
    //用户信息
    const userInfo = ref({})

    //设置用户信息
    function setUserInfo (newInfo){
        userInfo.value = newInfo
    }
    //删除用户信息
    function removeUserInfo (){
        userInfo.value = {}
    }

    //获取用户信息
    function getUserInfo(){
        return userInfo.value;
    }

    //登录

    //注册

    //修改密码
    

    return{userInfo,setUserInfo,getUserInfo,removeUserInfo}
},{persist:true})
//开启此仓库持久化

export default useUserStore
